package com.designPattern.proxy.cglib.cglib;

import com.designPattern.proxy.staticproxy.TeacherDao;

public class Test {
    public static void main(String[] args) {
        //创建被代理的对象
        TeacherDao teacherDao = new TeacherDao();
        //创建代理对象工厂
        ProxyFactory proxyFactory = new ProxyFactory(teacherDao);
        //通过代理工厂获取代理对象
        TeacherDao teacherDao2 = (TeacherDao) proxyFactory.getProxyInstance();
        //通过代理对象调用被增强的方法
        teacherDao2.teach();
    }
}
